#include<iostream>
#include<unistd.h>
using namespace std;
int main()
{
//创建子进程
  int id=fork();
  if(id ==0)
  {
   //子进程
  cout<< "I am child "<<getpid()<<endl;
  }
  else
  {
    //父进程
    cout<<id<<endl;
    cout<<"I am parent "<<getpid()<<endl;
  }
 return 0;
}
